package net.itgoo.parkingpay.rest.model;

import org.json.JSONObject;

public class ParkingParkModel {
    public int cid;
    public String address;
    public String name;
    public String contacts;
    public String phone;
    public double lat;
    public double lon;

    public static ParkingParkModel parse(JSONObject jsonObject) {
        ParkingParkModel parkModel = new ParkingParkModel();
        if (jsonObject != null) {
            try {
                parkModel.cid = jsonObject.getInt("cid");
                parkModel.address = jsonObject.getString("caddress");
                parkModel.name = jsonObject.getString("cname");
                parkModel.contacts = jsonObject.getString("contacts");
                parkModel.phone = jsonObject.getString("cphone");
                parkModel.lat = jsonObject.getDouble("lat");
                parkModel.lon = jsonObject.getDouble("lon");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return parkModel;
    }
}
